SKP 2 DAT SKP 2 ******************************** * * * 80-COLUMN SCREEN DUMP * * * ******************************** SKP 2 A1 = $3C A2 = $3E A3 = $40 DSPBUF = $280 SCREEN = $8B33 VECTOUT = $BE30 VIDDOS = $B7F1 ON80 = $C055 OFF80 = $C054 SLOT1 = $C100 COUT1 = $FDF0 COUT = $FDED CROUT = $FD8E skp 3 ORG $300 DUMP JSR PRON ;Turn on Printer in slot 1 LDX #$FF ;Initialize Line Index STX A1 :L1 INC A1 LDX A1 CPX #24 ;Finished? BCS :P ;Yes, skip to end LDA INDEX,X ;Get Start of line STA A2 ;into Zero-page pointer. LDA INDEX+24,X STA A2+1 LDY #0 ;Initialize character pointer. LDX #0 ;Init Buffer pointer. :L STA ON80 ;Turn on AuxMem :L3 LDA (A2),Y ;Get Even Character JSR FILTER ;Make it Text STA DSPBUF,X ;Put into Buffer INX ;Increment for next character STA OFF80 ;Turn off AuxMem TXA ;See if Even character LSR ;just read. BCS :L3 ;Yes, go back for Odd Character INY ;Increment for next character CPY #40 ;Done with line? BNE :L ;No, get another character JSR BUFOUT ;Yes, print the line. JSR CROUT ;Cap it with a C/R BNE :L1 ;Go back for more :P LDX #5 :L2 JSR CROUT DEX BPL :L2 JSR PROFF ;Turn off printer RTS ;Done! SKP 3 * Turn on Printing in slot 1 SKP 2 PRON LDA #SLOT1 STA VECTOUT+1 LDX #0 :L INX LDA INIT,X JSR COUT CPX INIT BCC :L RTS SKP 3 * Direct output to screen SKP 2 PROFF LDA #COUT1 STA VECTOUT+1 RTS SKP 3 * Condition output characters SKP 2 FILTER CMP #$80 ;If High bit set, handle below BCS :P2 CMP #$40 ;If Mousetext BCC :P1 ;($40<=x<$60) CMP #$60 BCS :P1 LDA #$20 ;make it a space :P1 CMP #$20 ;If Uppercase Inverse BCS :P ;(X<$20) ORA #$40 ;Make normal :P ORA #$80 ;and set High Bit :P2 CMP #$A0 ;If control character, BCS :P3 ;Make it a space LDA #$A0 :P3 RTS SKP 3 * Dump 80 character line to printer SKP 2 BUFOUT LDX #0 ;Init Pointer :L LDA DSPBUF,X ;Get Character JSR COUT ;Spit it out INX ;Increment for next CPX #80 ;If 80 characters, done! BCC :L RTS SKP 3 * Table of Line Addresses SKP 2 INDEX DFB $00,$80,$00,$80,$00,$80,$00,$80,$28,$A8,$28,$A8 DFB $28,$A8,$28,$A8,$50,$D0,$50,$D0,$50,$D0,$50,$D0 DFB 4,4,5,5,6,6,7,7,4,4,5,5,6,6,7,7,4,4,5,5,6,6,7,7 SKP 3 * Initialization String SKP 2 INIT DFB 4 ASC " 0N" DFB $8D